﻿<!DOCTYPE html>
<html lang="zh">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <title>天气预报 - EasyAPI服务市场</title>
  <link href="https://static.easyapi.com/css/site.min.css" rel="stylesheet"/>
  <link href="https://static.easyapi.com/css/header.css" rel="stylesheet"/>
  <meta name="descriptions" content="EasyAPI旗下天气预报API接口服务，整合多家天气预报接口。"/>
  <meta name="keywords" content="天气预报API,实况天气,生活指数"/>
  <link rel="stylesheet" href="https://cdn.bootcss.com/OwlCarousel2/2.3.4/assets/owl.theme.default.min.css">
  <link rel="stylesheet" href="https://cdn.bootcss.com/OwlCarousel2/2.3.4/assets/owl.carousel.min.css">
  <link rel="stylesheet" href="css/style.css">
</head>

<style>
  .m-serve {
    background: #f5f5f5;
  }
</style>

<body>
<header class="site-header" style="background-image:url(https://qiniu.easyapi.com/blue0712.png)">
  <div class="container">
    <div class="header">
      <ul class="header-logo">
        <li><a href="https://www.easyapi.com/"><img src="https://static.easyapi.com/images/market/logo.png"></a></li>
        <li><span>&nbsp;·&nbsp;</span><a href="index.html">天气预报</a></li>
      </ul>
      <ul class="nav">
        <li><a class="active" href="index.html">首页</a></li>
        <li><a href="code.html">天气现象编码表</a></li>
        <li><a href="aqi.html">空气质量指数</a></li>
        <li><a target="_blank" href="https://www.easyapi.com/api/?documentId=17044">文档</a></li>
      </ul>
      <ul class="side-nav">
        <li id="login"><a href="https://account.easyapi.com/login">登录</a></li>
        <li class="console dis_hide" id="console"><a href="/console/">控制台</a></li>
        <li class="avatar dis_hide" id="avatar">
          <img id="photo" src="https://qiniu.easyapi.com/user/default.jpg!icon.jpg">
          <div class="avatar-down">
            <div class="avatar-item">
              <a href="https://account.easyapi.com/notification/">我的通知</a>
            </div>
            <div class="avatar-item">
              <a href="https://account.easyapi.com/setting/data">个人设置</a>
            </div>
            <div class="avatar-item">
              <a href="https://account.easyapi.com/logout">退出</a>
            </div>
          </div>
        </li>
      </ul>
    </div>
    <div class="u-info f-tac" style="margin-top:80px;">
      <h2 class="f-ff48 title">整合多家天气预报接口</h2>
      <div class="u-searbox">
        <input type="text" id="textValue" placeholder="请输入城市名称或者IP地址">
        <!-- <a href="" class="btn"> -->
        <div onclick="getWeathser()" class="btn">
          <img src="https://static.easyapi.com/images/market/ip/icon.png">
        </div>
        <!-- </a> -->
      </div>
    </div>
    <div style="padding-left: 27.5%;font-size: 16px">
      <div class="u-info flex-c weather-result" id='weather-html'>
      </div>
    </div>
  </div>
</header>

<div class="m-centerbox ">
  <div class="container">
    <div class="u-title">我们的优势</div>
    <ul class="u-icons clearfix">
      <li>
        <img src="./images/accuracy.png">
        <p>数据精准</p>
      </li>
      <li>
        <img src="./images/property.png">
        <p>性能稳定</p>
      </li>
      <li>
        <img src="./images/strategy.png">
        <p>低价策略</p>
      </li>
      <li>
        <img src="./images/data.png">
        <p>全球数据</p>
      </li>
      <li>
        <img src="./images/simple.png">
        <p>简单易用</p>
      </li>
      <li>
        <img src="./images/wisdom.png">
        <p>智慧整合</p>
      </li>
      <li>
        <img src="./images/safeguard.png">
        <p>售后保障</p>
      </li>
      <li>
        <img src="./images/serve.png">
        <p>7x24小时服务</p>
      </li>
    </ul>
  </div>
</div>


<div class="m-centerbox page-weather f-bc-gray m-serve">
  <div class="u-title">我们的服务</div>
  <div class="u-servers f-cb container">
    <div class="item">
      <img src="https://static.easyapi.com/images/market/weather/ic9.png">
      <h3>全球城市</h3>
      <p>国内2568县级站<br>
        国际198个国家1518站</p>
    </div>
    <div class="item">
      <img src="https://static.easyapi.com/images/market/weather/ic151.png">
      <h3>实况天气</h3>
      <p>高频国内/际实况<br>
        最短5-10分钟更新</p>
    </div>
    <div class="item">
      <img src="https://static.easyapi.com/images/market/weather/ic10.png">
      <h3>生活指数</h3>
      <p>洗车、感冒、穿衣、污染、舒适度<br>
        空调、运动、旅游、交通、紫外线</p>
    </div>
    <div class="item">
      <img src="https://static.easyapi.com/images/market/weather/ic11.png">
      <h3>空气质量</h3>
      <p>国内434站AQI、PM2.5及SO2、NO2等污染级别、健康影响、建议措施</p>
    </div>
    <div class="item">
      <img src="https://static.easyapi.com/images/market/weather/ic12.png">
      <h3>天气预警</h3>
      <p>提供及时更新的中国城市气象灾害预警数据。<br>
        防患胜于救灾，气象灾害早知道。</p>
    </div>
    <div class="item">
      <img src="https://static.easyapi.com/images/market/weather/ic13.png">
      <h3>日常日落</h3>
      <p>全球各地每天日出日落时间，便于摄影、自然爱好者拍摄或观赏壮美的日出日落景象。</p>
    </div>
    <div class="item">
      <img src="https://static.easyapi.com/images/market/weather/ic14.png">
      <h3>农历节气</h3>
      <p>查询任何一个公历日期对应的农历日期、农历传统节日、节气、天干地支纪年月日及生肖属相。</p>
    </div>
    <div class="item">
      <img src="https://static.easyapi.com/images/market/weather/ic15.png">
      <h3>其他服务</h3>
      <p>根据大客户会员的需求免费定制开发API接口，让你的开发更加方便灵活。</p>
    </div>
  </div>
</div>

<div class="m-centerbox page-weather ">
  <div class="u-title">数据质量保障</div>
  <div class="u-baozhang f-cb container">
    <div class="item">
      <img src="https://static.easyapi.com/images/market/weather/ic16.png">
      <h3>权威数据</h3>
      <p>天气数据来自权威气象机构授权的官方数据，为您提供正规、合法的天气服务。</p>
    </div>
    <div class="item">
      <img src="https://static.easyapi.com/images/market/weather/ic17.png">
      <h3>智慧多数据源</h3>
      <p>智能融合国内外多家气象机构的权威数据，数据源互相补充备份，减少缺失概率。</p>
    </div>
    <div class="item">
      <img src="https://static.easyapi.com/images/market/weather/ic18.png">
      <h3>高可用性</h3>
      <p>EasyAPI天气拥有9年专业天气数据服务经验，API服务可用性高达99.9%以上。</p>
    </div>
  </div>
</div>

<footer class="footer f-cb">
  <p>
    <a href="https://www.easyapi.com/info/about">关于我们</a>
    <a href="https://www.easyapi.com/info/together">合作伙伴</a>
    <a href="https://www.easyapi.com/info/contact">联系我们</a>
    <a href="https://www.easyapi.com/info/donate">支持我们</a>
  </p>
  <p>Copyright © 2015～2021 帮趣团队</p>
  <p><a href="https://beian.miit.gov.cn" target="_blank">沪ICP备19007521号</a></p>
</footer>
<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/OwlCarousel2/2.3.4/owl.carousel.min.js"></script>
<script type="text/javascript" src="https://cdn.bootcss.com/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
<script src="https://static.easyapi.com/scripts/market/user.js"></script>
<script>
  $(document).ready(function () {
    searchIp()
  });

  function searchIp() {
    $.ajax({
      data: {
        appKey: 'X869YDFH159yi8f4',
        appSecret: 'Vx273b5SxB4kO8iP'
      },
      method: 'GET',
      url: 'https://api2.easyapi.com/api/ip',
      success: function (data) {
        var result = JSON.parse(data)
        if (result.code == '1') {
          var ip = result.content.ip
          search(ip)
        }
      }
    });
  }

  function search(ip) {
    $.ajax({
      method: 'GET',
      data: {
        ip: ip
      },
      url: 'https://api2.easyapi.com/weather/ip.json',
      beforeSend: function (request) {
        request.setRequestHeader("Authorization", "Bearer " + ($.cookie("authenticationToken")));
      },
      success: function (data) {
        var weather = {}
        weather = JSON.parse(data.message)
        var lbt = "";
        lbt += '<div class="flex-r today">'
          + '<img src="https://static.easyapi.com/images/market/weather/305155/' + weather.realtime.weather.img + '_0.png?imageView2/1/w/200/h/100/q/100" class="today-img" alt="">'
          + '<div class="flex-c">'
          + '<span style="font-size: 50px">' + weather.realtime.weather.temperature + '°</span>'
          + '<span style="font-size:18px">' + weather.realtime.weather.info + '</span>'
          + '</div>'
          + '<div class="flex-c pd-l-20" style="font-size: 18px;">'
          + '<div class="flex-r">'
          + '<div class="temperature">'
          + '<span>' + weather.weather[0].info.night[2] + '°~' + weather.weather[0].info.day[2] + '°</span>'
          + '</div>'
          + '<div class="humidity">'
          + '<span>相对湿度 ' + weather.realtime.weather.humidity + '</span>'
          + '</div>'
          + '</div>'
          + '<div class="flex-r" style="margin-top:10px">'
          + '<div class="wind">'
          + '<span>' + weather.realtime.wind.direct + ' ' + weather.realtime.wind.power + '</span>'
          + '</div>'
          + '<div class="humidity">'
          + '<span>空气质量' + weather.pm25.pm25.quality + ' ' + weather.pm25.pm25.pm25 + '</span>'
          + '</div>'
          + '</div>'
          + '</div>'
          + '</div>'
          + '<div class="flex-r future">'
          + '<div class="flex-c mid-align">'
          + '<span>今天</span>'
          + '<img src="https://static.easyapi.com/images/market/weather/305155/' + (weather.weather[0].info.day[0].length == 1 ? ('0' + weather.weather[0].info.day[0]) : weather.weather[0].info.day[0]) + '_0.png" alt="">'
          + '<span class="pd-t-10">' + weather.weather[0].info.day[1] + '</span>'
          + '<span class="future_temperature">' + weather.weather[0].info.night[2] + '°/' + weather.weather[0].info.day[2] + '°</span>'
          + '</div>'
          + '<div class="flex-c mid-align second-day">'
          + '<span>明天</span>'
          + '<img src="https://static.easyapi.com/images/market/weather/305155/' + (weather.weather[1].info.day[0].length == 1 ? ('0' + weather.weather[0].info.day[0]) : weather.weather[0].info.day[0]) + '_0.png" alt="">'
          + '<span class="pd-t-10">' + weather.weather[1].info.day[1] + '</span>'
          + '<span class="future_temperature">' + weather.weather[1].info.night[2] + '°/' + weather.weather[1].info.day[2] + '°</span>'
          + '</div>'
          + '<div class="flex-c mid-align">'
          + '<span>后天</span>'
          + '<img src="https://static.easyapi.com/images/market/weather/305155/' + (weather.weather[2].info.day[0].length == 1 ? ('0' + weather.weather[0].info.day[0]) : weather.weather[0].info.day[0]) + '_0.png" alt="">'
          + '<span class="pd-t-10">' + weather.weather[2].info.day[1] + '</span>'
          + '<span class="future_temperature">' + weather.weather[2].info.night[2] + '°/' + weather.weather[2].info.day[2] + '°</span>'
          + '</div>'
          + '</div>';
        $("#weather-html").empty()
        $("#weather-html").append(lbt);
      }
    });
  }

  function getWeathser() {
    $.ajax({
      method: 'GET',
      data: {
        cityName: $("#textValue").val(),
      },
      url: 'https://api.easyapi.com/weather/city.json',
      beforeSend: function (request) {
        request.setRequestHeader("Authorization", "Bearer " + ($.cookie("authenticationToken")));
      },
      success: function (data) {
        var weather = {}
        weather = JSON.parse(data).data
        var lbt = "";
        lbt += '<div class="flex-r today">'
          + '<img src="https://static.easyapi.com/images/market/weather/305155/' + weather.realtime.weather.img + '_0.png?imageView2/1/w/200/h/100/q/100" class="today-img" alt="">'
          + '<div class="flex-c">'
          + '<span style="font-size: 50px">' + weather.realtime.weather.temperature + '°</span>'
          + '<span style="font-size:18px">' + weather.realtime.weather.info + '</span>'
          + '</div>'
          + '<div class="flex-c pd-l-20" style="font-size: 18px;">'
          + '<div class="flex-r">'
          + '<div class="temperature">'
          + '<span>' + weather.weather[0].info.night[2] + '°~' + weather.weather[0].info.day[2] + '°</span>'
          + '</div>'
          + '<div class="humidity">'
          + '<span>相对湿度 ' + weather.realtime.weather.humidity + '</span>'
          + '</div>'
          + '</div>'
          + '<div class="flex-r" style="margin-top:10px">'
          + '<div class="wind">'
          + '<span>' + weather.realtime.wind.direct + ' ' + weather.realtime.wind.power + '</span>'
          + '</div>'
          + '<div class="humidity">'
          + '<span>空气质量' + weather.pm25.pm25.quality + ' ' + weather.pm25.pm25.pm25 + '</span>'
          + '</div>'
          + '</div>'
          + '</div>'
          + '</div>'
          + '<div class="flex-r future">'
          + '<div class="flex-c mid-align">'
          + '<span>今天</span>'
          + '<img src="https://static.easyapi.com/images/market/weather/305155/' + (weather.weather[0].info.day[0].length == 1 ? ('0' + weather.weather[0].info.day[0]) : weather.weather[0].info.day[0]) + '_0.png" alt="">'
          + '<span class="pd-t-10">' + weather.weather[0].info.day[1] + '</span>'
          + '<span class="future_temperature">' + weather.weather[0].info.night[2] + '°/' + weather.weather[0].info.day[2] + '°</span>'
          + '</div>'
          + '<div class="flex-c mid-align second-day">'
          + '<span>明天</span>'
          + '<img src="https://static.easyapi.com/images/market/weather/305155/' + (weather.weather[1].info.day[0].length == 1 ? ('0' + weather.weather[0].info.day[0]) : weather.weather[0].info.day[0]) + '_0.png" alt="">'
          + '<span class="pd-t-10">' + weather.weather[1].info.day[1] + '</span>'
          + '<span class="future_temperature">' + weather.weather[1].info.night[2] + '°/' + weather.weather[1].info.day[2] + '°</span>'
          + '</div>'
          + '<div class="flex-c mid-align">'
          + '<span>后天</span>'
          + '<img src="https://static.easyapi.com/images/market/weather/305155/' + (weather.weather[2].info.day[0].length == 1 ? ('0' + weather.weather[0].info.day[0]) : weather.weather[0].info.day[0]) + '_0.png" alt="">'
          + '<span class="pd-t-10">' + weather.weather[2].info.day[1] + '</span>'
          + '<span class="future_temperature">' + weather.weather[2].info.night[2] + '°/' + weather.weather[2].info.day[2] + '°</span>'
          + '</div>'
          + '</div>';
        $("#weather-html").empty()
        $("#weather-html").append(lbt);
      }
    });
  }
</script>

</body>

</html>
